import Mock from 'mockjs'
import homeApi from './mockServeData/home.js'
import user from './mockServeData/user.js'
import permission from './mockServeData/permission.js'
import mall from './mockServeData/mall.js'
import account from './mockServeData/account'
import goods from './mockServeData/goods'
import shop from './mockServeData/shop'

// 定义mock 请求拦截
Mock.mock('/api/home/getData', homeApi.getStatisticalData)

// 用户列表的数据
Mock.mock('/api/user/add', 'post', user.createUser)
Mock.mock('/api/user/edit', 'post', user.updateUser)
Mock.mock('/api/user/del', 'post', user.deleteUser)
Mock.mock(/api\/user\/getUser/, user.getUserList)
Mock.mock(/api\/permission\/getMenu/, 'post', permission.getMenu)
Mock.mock(/api\/mall\/getMall/, mall.getMallList)
Mock.mock('/api/mall/del', 'post', mall.deleteMall)
Mock.mock('/api/account/del', 'post', account.deleteAccount)
Mock.mock('/api/account/add', 'post', account.createAccount)
Mock.mock('/api/account/edit', 'post', account.updateAccount)
Mock.mock(/api\/goods\/getGoods/, goods.getGoodsList)
Mock.mock('/api/goods/add', 'post', goods.createGoods)
Mock.mock('/api/goods/edit', 'post', goods.updateGoods)
Mock.mock('/api/goods/edit', 'post', goods.shopUpdateGoods)
Mock.mock('/api/goods/del', 'post', goods.deleteGoods)
Mock.mock('/api/goods/del', 'post', goods.shopDeleteGoods)
Mock.mock('/api/shop/add', 'post', shop.createShop)
Mock.mock('/api/shop/edit', 'post', shop.updateShop)
Mock.mock('/api/shop/del', 'post', shop.deleteShop)